class CreateReplicaSystems < ActiveRecord::Migration
  def self.up
    create_table :replica_systems do |t|
      t.string :name, :null => :no
	  t.string :hostname, :null => :no
	  t.string :username, :password, :protocol, :internal_uri
	  t.boolean :main, :default => false
      t.timestamps
    end
	
	add_column :audio_assets, :uri, :string
	add_column :audio_assets, :format, :string
	add_column :audio_assets, :length, :string
	add_column :audio_assets, :md5_hash, :string
	add_column :audio_assets, :duration, :integer
  end

  def self.down
    drop_table :replica_systems
	# drop essences table and metadata_files table
	drop_table :essences
	drop_table :metadata_files
	remove_column :audio_assets, :uri
	remove_column :audio_assets, :format
	remove_column :audio_assets, :length
	remove_column :audio_assets, :md5_hash
	remove_column :audio_assets, :duration
  end
end
